package delayQueue;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

public class Main {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(1);
        DelayQueueService<DelayQueueElement> delayQueueService = new DelayQueueServiceImpl<>();
        delayQueueService.addElements("test",new DelayQueueElement(1000,TimeUnit.MILLISECONDS,new SendMessageTask("1"))
                , new DelayQueueElement(2000,TimeUnit.MILLISECONDS,new SendMessageTask("2"))
                , new DelayQueueElement(3000,TimeUnit.MILLISECONDS,new SendMessageTask("3"))
                , new DelayQueueElement(4000,TimeUnit.MILLISECONDS,new SendMessageTask("4"))
        );
        delayQueueService.addElements("test1",new DelayQueueElement(21000,TimeUnit.MILLISECONDS,new SendMessageTask("5"))
                , new DelayQueueElement(11000,TimeUnit.MILLISECONDS,new SendMessageTask("6"))
                , new DelayQueueElement(11000,TimeUnit.MILLISECONDS,new SendMessageTask("7"))
                , new DelayQueueElement(11000,TimeUnit.MILLISECONDS,new SendMessageTask("8"))
        );

        delayQueueService.addElement("test44",new DelayQueueElement(10000,TimeUnit.MILLISECONDS,new SendMessageTask("9"))
        );
//        executorService.submit();
    }
}
